<template>
    <div>
        <div>
            <van-nav-bar title="订单管理" left-text="返回" left-arrow @click-left="onClickLeft" />
        </div>
        <div class="tap-bar">
            <van-tabs v-model:active="active">
                <van-tab title="全部"><Oders></Oders></van-tab>
                <van-tab title="已交易"><Unpaid></Unpaid></van-tab>
                <van-tab title="待提货"><Paid></Paid></van-tab>
                <van-tab title="已提货"><Pickedup></Pickedup></van-tab>
            </van-tabs>
        </div>

    </div>
</template>

<script lang="ts" setup>
import { type Ref,ref,onMounted,onUpdated } from 'vue'
import Oders from '@/views/My/Oders.vue'
import Unpaid from '@/views/My/Unpaid.vue'
import Paid from '@/views/My/Paid.vue'
import Pickedup from '@/views/My/Pickedup.vue'
import {useRoute,useRouter} from 'vue-router'
const route = useRoute()
const router = useRouter()

const active:Ref = ref(0);
const onClickLeft = () => {
    router.push('/my')
}

onMounted(() => {
    active.value = Number(route.query.msg) 
})
onUpdated(() => {
//    console.log(1);
})

</script>

<style lang="scss" scoped>
.van-search {
    border-radius: 8px;
    background-color: #EDEDED;
}
</style>